<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQiiStoragesTinyTable extends Migration
{
    /**
     * Schema table name to migrate
     * @var string
     */
    public $set_schema_table = 'qii_storages_tiny';

    /**
     * Run the migrations.
     * @table qii_storages_tiny
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable($this->set_schema_table)) return;
        Schema::create($this->set_schema_table, function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('ID');
            $table->string('name', 20)->default('')->comment('服务器名称');
            $table->unsignedInteger('category_id')->default('0')->comment('文件存储类型ID');
            $table->string('host', 200)->default('')->comment('网站域名');
            $table->text('description')->comment('详细介绍');
            $table->text('config')->comment('配置');
            $table->unsignedTinyInteger('is_enable')->default('0')->comment('是否启用[0 : 停用, 1 : 启用]');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
     public function down()
     {
       Schema::dropIfExists($this->set_schema_table);
     }
}
